package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.MysqlUtil.MysqlUtil;
import com.atguigu.userprofile.bean.Taskinfo;


import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;

public class TaskinfoDao {
    public static void main(String[] args) throws SQLException, NoSuchFieldException, ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException {
        Taskinfo taskinfo = selectTaskInfoById("1");
        System.out.println(taskinfo);
    }

    public static Taskinfo selectTaskInfoById(String taskId) throws SQLException, NoSuchFieldException, ClassNotFoundException, InvocationTargetException, InstantiationException, IllegalAccessException {

        String querysql="SELECT id,task_name,task_status,task_comment, task_type,exec_type," +
                "main_class,file_id,task_args,task_sql,task_exec_level,create_time FROM task_info where id="+taskId;
        Taskinfo selectone = MysqlUtil.selectone(querysql, Taskinfo.class, true);

        return selectone;

    }


}
